package com.uziot.bucket.service;

import com.uziot.bucket.dao.mapper.PersionHouseMapper;
import com.uziot.galaxy.common.framework.component.AbstractExtractDataPageCmp;
import com.uziot.galaxy.dbtools.extract.ExtractDataCmpType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.List;
import java.util.Map;

/**
 * 功能描述: <br>
 * <>
 *
 * @author shidt
 * @date 2022-06-01 21:12
 */

public class PersonHouseDataService extends AbstractExtractDataPageCmp {
    private static final Logger log = LoggerFactory.getLogger(PersonHouseDataService.class);

    private PersionHouseMapper persionHouseMapper;

    public PersionHouseMapper getPersionHouseMapper() {
        return persionHouseMapper;
    }

    @Override
    public String getCmpType() {
        return ExtractDataCmpType.PAGE;
    }

    public void setPersionHouseMapper(PersionHouseMapper persionHouseMapper) {
        this.persionHouseMapper = persionHouseMapper;
    }

    public PersonHouseDataService(String filePath, String fileName, Integer rowNum) {
        super(filePath, fileName, rowNum);
    }


    @Override
    public Integer getDataCount() {
        return persionHouseMapper.selectCount();
    }

    @Override
    public List<Map<String, Object>> getDataList(Integer startIndex, Integer rowNum, int i) {
        return persionHouseMapper.selectList(startIndex, rowNum);
    }

    @Override
    public String getLineContent(Map<String, Object> map) {
        return map.get("NAME") +
                "-" +
                map.get("CTFID") +
                "\n";
    }

}
